<?php
/**
 * This file is part of webman.
 *
 * Licensed under The MIT License
 * For full copyright and license information, please see the MIT-LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @author    walkor<walkor@workerman.net>
 * @copyright walkor<walkor@workerman.net>
 * @link      http://www.workerman.net/
 * @license   http://www.opensource.org/licenses/mit-license.php MIT License
 */

use Webman\Route;

// 匹配所有options路由
Route::options('[{path:.+}]', function () {
    return response('');
});

Route::group('/api', function () {

    Route::get('/test', ['app\controller\IndexController', 'test']);//测试接口
    Route::post('/wxshop/notify', ['app\controller\WxshopNotifyController', 'notify']);//测试接口
    Route::get('/tutorial', ['app\controller\IndexController', 'tutorial']);//使用教程

    Route::group('/game', function () {
        Route::post('/login', ['app\controller\GameController', 'login']);//游戏登录
    });


    Route::group('/login', function () {
        Route::post('/index', ['app\controller\LoginController', 'index']);//登录
    });

    Route::group('/user', function () {
        Route::get('/info', ['app\controller\UserController', 'info']);//获取用户信息
        Route::post('/update_info', ['app\controller\UserController', 'update_info']);//修改昵称和头像
        Route::post('/change_wx_notice', ['app\controller\UserController', 'change_wx_notice']);//变更微信消息通知状态
        Route::post('/update_qrcode', ['app\controller\UserController', 'update_qrcode']);//修改小程序码
        Route::get('/get_qrcode_details', ['app\controller\UserController', 'get_qrcode_details']);//获取该小程序码详情
        Route::post('/bind_qrcode', ['app\controller\UserController', 'bind_qrcode']);//绑定手机号
        Route::post('/unbind_qrcode', ['app\controller\UserController', 'unbind_qrcode']);//解绑挪车码
        Route::post('/send_subscribe_message', ['app\controller\UserController', 'send_subscribe_message']);//发送订阅消息
        Route::post('/bind_phone', ['app\controller\UserController', 'bind_phone']);//绑定虚拟手机号
        Route::post('/create_experience_qrcode', ['app\controller\UserController', 'create_experience_qrcode']);//生成体验码
        Route::post('/unbind_experience_qrcode', ['app\controller\UserController', 'unbind_experience_qrcode']);//解绑体验码
        Route::get('/get_test_qrcode_details', ['app\controller\UserController', 'get_test_qrcode_details']);//通过参数获取体验码信息
        Route::get('/get_wx_map', ['app\controller\UserController', 'get_wx_map']);//获取微信地图位置
        Route::get('/get_reward_list', ['app\controller\UserController', 'get_reward_list']);//获取奖励列表
        Route::post('/apply_withdraw', ['app\controller\UserController', 'apply_withdraw']);//用户申请提现
        Route::post('/confirm_reward', ['app\controller\UserController', 'confirm_reward']);//确认收款
        Route::get('/statistics', ['app\controller\UserController', 'statistics']);//统计
        Route::get('/member_list', ['app\controller\UserController', 'member_list']);//成员列表
        Route::post('/set_scan_record', ['app\controller\UserController', 'set_scan_record']);//设置扫码记录
    });


    Route::group('/qrcode', function () {
        Route::post('/create_qrcode_data', ['app\controller\CarQrcodeController', 'create_qrcode_data']);//创建小程序码数据
        Route::post('/create_qrcode', ['app\controller\CarQrcodeController', 'create_qrcode']);//创建小程序码
    });

    Route::group('/help', function () {
        Route::get('/list', ['app\controller\HelpController', 'list']);//帮助列表
    });

    Route::group('/shop', function () {
        Route::get('/list', ['app\controller\ShopController', 'list']);//获取微信小店商品列表
        Route::get('/get', ['app\controller\ShopController', 'get']);//获取微信小店商品详情
    });

});





